package edu.sctu.practice.class02.renzhaoxu.assign03.assign03_02;

/**
 * Created by Administrator on 2015/10/30.
 */
public class ComparableCylinder extends Cylinder  implements Comparable  {


    @Override
    public int compareTo(Object o) {

        if(getLength()>((Cylinder) o).getLength())

            return 1;
        else if (getLength() < ((Cylinder) o).getLength())

            return -1;
        else
            return 0;
    }

    public ComparableCylinder(double length){

        super(length);
    }


}
